package com.chekulab.temp.ui

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import com.chekulab.temp.R
import com.chekulab.temp.contract.MainContract
import com.chekulab.temp.presenter.MainPresenter
import com.chekulab.temp.view.RxTextViewVertical
import com.google.gson.Gson
import kotlinx.android.synthetic.main.activity_main.*
import java.util.ArrayList

class MainActivity : AppCompatActivity(), MainContract.View {
    override fun showMessage(msg: String?) {
        Toast.makeText(this, msg, Toast.LENGTH_LONG).show()
    }

    override fun showStringList(list: List<String?>) {
        mText.setTextList(list.reversed())
        mText.setText(26f, 5, -0x899eaa)//设置属性
        mText.setTextStillTime(3000)//设置停留时长间隔
        mText.setAnimTime(300)//设置进入和退出的时间间隔
        mText.startAutoScroll()

    }

    lateinit var presenter: MainPresenter;
    lateinit var mText: RxTextViewVertical
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        mText = findViewById(R.id.text)
        presenter = MainPresenter(this)
        presenter.getStringList()

    }


    override fun onPause() {
        super.onPause()
        mText.stopAutoScroll()

    }
}
